<template>
  <div class="more-action">
    <!-- 状态一-->
    <van-cell-group v-if="!isReport">
      <van-cell @click="dislike">不感兴趣</van-cell>
      <van-cell is-link
                @click="showReport">反馈垃圾内容</van-cell>
      <van-cell>拉黑作者</van-cell>
    </van-cell-group>
    <!-- 状态二-->
    <van-cell-group v-else>
      <van-cell icon="arrow-left"
                @click="closeReport">返回</van-cell>
      <van-cell v-for="item in reportsList"
                @click="resport(item.value)"
                :key="item.value">{{item.label}}</van-cell>
    </van-cell-group>
  </div>
</template>

<script>
import reportTypeList from '@/constant/reports'
export default {
  name: 'MoreAction',
  data () {
    return {
      isReport: false, // 是否是处于状态二
      reportsList: reportTypeList
    }
  },
  methods: {
    showReport () {
      this.isReport = true
    },
    closeReport () {
      this.isReport = false
    },
    // 不感兴趣
    dislike () {
      this.$emit('dislike')
    },
    // 垃圾内容
    resport (type) {
      this.$emit('resport', type)
      this.isReport = false
    }
  }
}
</script>

<style lang='less' scoped>
.more-action {
  border-radius: 4px;
}
</style>
